package com.zry.yard.been


import android.databinding.BaseObservable
import android.os.Parcel
import android.os.Parcelable
import java.io.Serializable

/**
 * 网络请求
 */

data class HttpResponse<T>(var State: String, var Message: String, var ResultData: T)


/**
 * spinner下拉框
 */
data class SpinnerBean(var dataId: String, var dataName: String) : Serializable

/**
 * 首页数据
 */
data class HomePageBean(var homePageImg: Int, var homePageName: String) : Serializable


/**
 * 操作记录
 */
data class OperationRecordBean(var operationTime: String, var productName: String, var level: String,
                               var operationNumber: String, var operationName: String) : Serializable, BaseObservable()

/**
 * 登录时返回的数据
 */
data class LoginInfoBean(var UserName: String, var userid: String,
                         var EntID: String, var EntName: String,
                         var EntCategoryName: String, var EntCategoryID: String,
                         var RoleID: String, var RoleName: String,
                         var RoleType: String, var TraceCodetMonthCount: String,
                         var ScavebTraCodeMonthCount: String,
                         var MessageMonthCount: String, var TraceCountCount: String,
                         var ScavebTraCodeCount: String, var MessageCount: String,
                         var BasicCode: MutableList<BasicBean>
) : Serializable, BaseObservable()
data class BasicBean(var BasicName: String, var BasicCode: String, var BasicImg: Int) : Serializable


/**
 * 入库方式
 */
data class PutStorageMethod(var putStorageName: String, var putStorageId: String) : Serializable

/**
 * 获取产品信息
 */
data class ProductInfo(var ProductID: String, var ProductName: String, var BrandName: String,
                       var CategoryName: String, var NetContent: String, var UnitID: String, var UnitName: String,
                       var PackSpecificationId: String, var PackName: String) : Serializable, BaseObservable()

/**
 * 生产批次
 */
data class BatchInfo(var BatchID: String, var BatchName: String) : Serializable, BaseObservable()

/**
 * 生产线
 */
data class ProductLine(var ProductionLineID: String, var ProductionLineName: String, var PersonName: String) : Serializable, BaseObservable()

/**
 * 装箱单位列表
 */
data class PacKBean(var PackID: String, var PackName: String)

/**
 * 获取长追溯码
 */
data class ResultCode(var state: String, var CodeID: String)

/**
 * 获取长流通码
 */
data class ResultFlowCode(var state: String, var Code: String)

/**
 * 长码和短码列表
 */
data class LongAndShortCode(var longCode: String, var shortCode: String) : Serializable, Parcelable {
    constructor(parcel: Parcel) : this(
            parcel.readString(),
            parcel.readString())

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeString(longCode)
        parcel.writeString(shortCode)
    }

    override fun describeContents(): Int {
        return 0
    }

    companion object CREATOR : Parcelable.Creator<LongAndShortCode> {
        override fun createFromParcel(parcel: Parcel): LongAndShortCode {
            return LongAndShortCode(parcel)
        }

        override fun newArray(size: Int): Array<LongAndShortCode?> {
            return arrayOfNulls(size)
        }
    }
}

/**
 * 返回的数据
 */
data class PackResultCode(var Cid: String, var Code: String) : Serializable


data class ResultData<T>(var state: String, var t: T) : Serializable

data class ResultCodeData<T>(var state: String, var Message: String, var FlowCodeID: String, var t: T) : Serializable

/**
 * 请求成功实体类
 */
data class ResultBean<T>(var State: String, var Message: String, var ResultData: T)


/**
 * 装箱记录
 */
data class FlowCode(var FlowCodeID: String, var BrandName: String, var ProductName: String, var NetUnitPact: String, var ProductID: String,
                    var FlowLevel: String, var Quantity: String, var PackRadio: String, var PackUnit: String, var PackUnitName: String,
                    var CreateDate: String, var CreateUserID: String, var CreateUserName: String) : Serializable, BaseObservable()


/**
 * 批量打包详情
 */
data class PackingInfo(var state: String, var data: MutableList<CodeList>, var ProductName: String, var NetUnitPack: String, var Packing: String,
                       var DetailNum: String) : Serializable, BaseObservable()

data class CodeList(var Code: String)

/**
 * 号段打包详情
 */
data class FlowCodeDetail(var state: String, var MinCode: String, var MaxCode: String, var CodeS: String,
                          var ProductName: String, var NetUnitPack: String, var Packing: String,
                          var DetailNum: String, var DataList: ArrayList<FlowCodeDetailData>) : Serializable, BaseObservable()


data class FlowCodeDetailData(var TraceList: ArrayList<FlowCodeDetailDataCode>, var CodeDuan: String, var Code: String) : Serializable


data class FlowCodeDetailDataCode(var CodeID: String) : Serializable

/**
 * 入库单列表
 * 订单id   StoreOrderID
 * 订单编号 StoreOrderCode
 * 入库类型（1=单品入库2=二级码入库3=三级码入库） StoreType
 * 入库方式（1=手动入库2=自动入库） StateID
 * 批次名称 BatchName
 * 产线名称  ProductionLineName
 * 产品名称  ProductName
 * 品牌名称 BrandName
 * 产品规格（例“50kg/箱”） NetUnitPackName
 * 入库数量  ProductCount
 * 单位  PackSpecificationName
 * 入库单日期  OrderState
 * 创建时间   CreateDate
 * 企业名称   EnterpriseName
 * 集团名称   CompanyName
 * 行业类别名称   ErCategoryName
 */
data class StoreOrderBean(var StoreOrderID: String, var StoreOrderCode: String, var StoreType: String, var StateID: String, var BatchName: String, var ProductionLineName: String,
                          var ProductName: String, var BrandName: String, var NetUnitPackName: String, var ProductCount: String, var PackSpecificationName: String, var OrderState: String,
                          var CreateDate: String, var EnterpriseName: String, var CompanyName: String, var ErCategoryName: String) : Serializable, BaseObservable()

/**
 * 入库记录详情
 */
data class StoreDetail(var state: String, var DetailID: String, var StoreOrderID: String, var StoreDate: String, var ProductID: String, var ProductName: String,
                       var NetUnitPack: String, var BatchName: String, var BatchID: String, var ProductionLineID: String, var ProductionLineName: String,
                       var StoreType: String, var CodeS: String, var MinCode: String, var MaxCode: String, var CreateUserName: String, var StoreOrderCode: String) : Serializable, BaseObservable()

/**
 * 出库订单列表
 */
data class OutStock(var OutStockID: String, var OutStockCode: String, var OutStockDate: String, var Quantity: String, var EnterpriseName: String, var EnterpriseID: String,
                    var CustomerID: String, var CustomerName: String, var MobilePhone: String, var CusAddress: String, var Status: String, var OutStockUserID: String,
                    var OutStockUserName: String, var CreateUserName: String, var CreateUserID: String, var CreateDate: String) : Serializable, BaseObservable()


/**
 * 出库记录列表
 *  DetailID                出 库记录ID
 *  OutStockID              出库单ID
 *  OutStockCode            出库编号
 *  OutStockDate            出库日期
 *  MaxCode                 最大码
 *  MinCode                 最小码
 *  OutStockPackLeval       出库级别（1=单码出库2=二级码出库3=三级码出库）
 *  OutStockType            出库方式（1=号段2=单码）
 *  CustomerName            接收经销商
 *  CustomerID              接收经销商ID
 *  Quantity                出库数量
 *  PackUnitName            单位
 *  ProductName             产品名称
 *  ProductID               产品ID
 *  NetUnitPack             产品规格
 *  CodeS                   批量码
 *  CreateUserName          出库用户
 */
data class OutDetailBean(var state: String, var DetailID: String, var OutStockID: String, var OutStockCode: String, var OutStockDate: String, var MaxCode: String,
                         var MinCode: String, var OutStockPackLeval: String, var OutStockType: String, var CustomerName: String, var CustomerID: String,
                         var Quantity: String, var PackUnitName: String, var ProductName: String, var ProductID: String, var NetUnitPack: String,
                         var CodeS: String, var CreateUserName: String) : Serializable, BaseObservable()

/**
 * var Level :String,   装箱级别
 * ProductName          产品名称
 * NetUnitPack          产品规格
 * PackUnit             装箱单位
 * Radio                装箱比例
 * CodeNum              当前数量
 * state=1成功state=0   失败
 */
data class FlowCodeInfo(var Level: String, var ProductName: String, var NetUnitPack: String, var CodeID: String,
                        var PackUnit: String, var Radio: String, var CodeNum: String, var state: String, var codes: String) : Serializable, BaseObservable()


/**
 * 打印二维码的类
 */
data class FlowCodeInfoBean(var productName: String, var flowCode: String, var flowShortCode: String, var flowChildMinCode: String, var flowChildMaxCode: String)

/**
 * 补码、拆码记录
 */
data class FlowRecord(var state: String, var RecordID: String, var ProductID: String, var BrandID: String, var BrandName: String,
                      var ProductName: String, var NetUnitPack: String, var RecordType: String, var Quatity: String,
                      var CreateDate: String, var EnterpriseID: String, var CreateUserID: String, var CreateUserName: String, var StateID: String) : Serializable


/**
 * App新接口用到的实体类
 */
/**
 * 获取产品列表
 */
data class ProductNameBean(var ProductImage: String, var ProductID: String, var ProductName: String, var BrandName: String, var CategoryName: String,
                           var NetUnitPack: String, var ExpiryDate: String) : Serializable, BaseObservable()

/**
 * 获取溯源录入列表
 */

data class BatchInfoBean(var BatchID: String, var BatchCode: String, var BatchName: String, var ProductID: String,
                         var ProductName: String, var BrandName: String, var NetUnitPack: String,
                         var ModelID: String, var ModelName: String, var CreateDate: String) : Serializable, BaseObservable()

/**
 * 获取批次详情
 */
data class BatchNextInfo(var BatchName: String, var BatchCode: String, var ModelID: String, var ModelName: String,
                         var ProductName: String, var BrandName: String, var NetUnitPack: String, var CreateDate: String,
                         var DetailList: MutableList<BatchDetail>, var OPeraList: MutableList<BatchOPera>) : Serializable

data class BatchDetail(var DetailID: String, var DetailName: String) : Serializable
data class BatchOPera(var DetailID: String, var DetailName: String, var OperaID: String, var OperaName: String, var OperaDate: String, var Address: String, var Remark: String) : Serializable

/**
 * 获取模板列表
 */
data class ModelBean(var ModelID: String, var ModelName: String) : Serializable

/**
 * 入库状态
 */
data class PutState(var putStorageId: Int, var putStorageName: String)

/**
 * 入库订单详情
 */
data class StoreOrderInfo(var StoreOrderCode: String, var StoreOrderID: String, var StoreType: String, var StateID: String,
                          var BatchID: String, var BatchName: String, var ProductionLineName: String, var ProductName: String,
                          var BrandName: String, var CreateDate: String, var FinishDate: String, var OrderState: String,
                          var StoreQuatity: String, var UnitName: String) : Serializable

/**
 * 获取经销商信息
 */
data class CustomerInfo(var CustomerID: String, var CustomerName: String, var CustomerCode: String, var Email: String, var MobilePhone: String,
                        var ProvinceName: String, var ProvinceID: String, var CityName: String, var CityID: String,
                        var AreaID: String, var AreaName: String, var Address: String, var Contacts: String,
                        var Remark: String) : Serializable

/**
 * 获取经销商详情
 */
data class CustomerDetail(var CustomerID: String, var CustomerName: String, var CustomerCode: String, var Region: String, var Address: String,
                          var Contacts: String, var MobilePhone: String, var dataList: MutableList<FilePath>)

data class FilePath(var FilePath: String)

/**
 * 出库订单详情
 */

data class OutStockInfo(var OutStockID: String, var OutStockCode: String, var OutStockDate: String, var CustomerID: String,
                        var CustomerName: String, var Contacts: String, var MobilePhone: String, var DealerName: String,
                        var DealerContacts: String, var DealerMobilePhone: String, var CarNum: String, var DriverName: String,
                        var DriverPhone: String)

/**
 * 出库清单
 */
data class OutgoingBean(var ProductName: String, var NetUnitPack: String, var Quality: String)

/**
 * 库存产品
 * ProductCategory:蔬菜产品
 * ExpiryDate:保质期
 */


data class StockProduct(var EnterpriseID: String, var EnterpriseName: String, var ProductName: String, var StockType: String,
                        var BrandName: String, var NetUnitPack: String, var PackUnitName: String, var PackRadio: String,
                        var OrderQuality: String, var OutQuality: String, var NowQuality: String, val ProductID: String,
                        val ProductImage: String, val ExpiryDate: String, val ProductCategory: String) : Serializable

/**
 * 追溯码查询信息
 */
data class TraceCodeBean(var ProductName: String, var BrandName: String, var ExpiryDate: String, var NetUnitPack: String,
                         var UPCCode: String, var BatchName: String, var BatchCode: String, var OrderCode: String,
                         var StateID: String, var StoreType: String, var ProductionLineName: String, var PersonName: String,
                         var OrderDate: String, var OrderUserName: String, var OutStockCode: String, var OutStateID: String,
                         var OutType: String, var OutDate: String, var OutUserName: String, var CustomerName: String,
                         var CusContacts: String, var DealerName: String, var DealerContacts: String, var CarNum: String,
                         var DriverName: String, var Code: String, var SecurityCode: String, var CodeCount: String,
                         var FirstCodeAddress: String, var FirstCodeDate: String, var SeCodeCount: String, var FirstSeCodeAddress: String,
                         var FirstSeCodeDate: String) : Serializable

/**
 * 流通吗查询信息
 */
data class FlowCodeBean(var ProductName: String, var BrandName: String, var ExpiryDate: String, var NetUnitPack: String,
                        var UPCCode: String, var Code: String, var FlowLevel: String, var PackUnitName: String,
                        var PackRadio: String, var CreateUserName: String, var CreateDate: String, var OrderCode: String,
                        var StateID: String, var StoreType: String, var ProductionLineName: String, var PersonName: String,
                        var OrderDate: String, var OrderUserName: String, var OutStockCode: String, var OutStateID: String,
                        var OutType: String, var OutDate: String, var OutUserName: String) : Serializable


data class MsgResultBean(var State: String, var Message: String, var ResultData: OperaID)


/**
 * 溯源录入返回id
 */
data class OperaID(var OperaID: String)

/**
 * 发送消息列表
 */
data class SendOutNotice(var NoticeID: String, var NoticeTitle: String, var SendTypeID: String, var SendTypeValue: String,
                         var ViewCount: String, var CategoryID: String, var ParaName: String, var IsSend: String,
                         var CreateTime: String) : Serializable

/**
 * 接收通知列表
 */
data class ReceiveNotice(var NoticeUserID: String, var NoticeID: String, var NoticeTitle: String, var CreateTime: String,
                         var CreateUserName: String, var ParaName: String, var IsRead: String) : Serializable

/**
 * 通知详情
 */
data class NoticeInfo(var NoticeID: String, var NoticeBody: String, var NoticeTitle: String, var CategoryName: String, var CreateTime: String)




